package sf.md.create.prototype.deep;

public class Client {

    public static void main(String[] args){

        People people = new People();
        Dog dog  = new Dog();
        dog.setName("sfy的dog");
        people.setName("songfangyuan");
        people.setDog(dog);
        try {
            People people1 = (People) people.clone();
            People people2 = (People) people.clone();
            people1.getDog().setName("songbingbing的dog");
            System.out.println("dog:"+people1.getDog().toString());
            System.out.println("dog:"+people2.getDog().toString());

        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }

    }
}
